package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateLoggerReleaseLogGetPageDTO;
import com.itlong.cloud.POJO.PO.OperateReleaseLogPO;
import com.itlong.cloud.POJO.VO.operate.OperateReleaseLogVO;
import com.itlong.cloud.noncore.operate.IOperateReleaseLogServiceClient;
import com.itlong.cloud.operate.service.IOperateLoggerReleaseLogService;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      运营-日志管理-日志发布业务处理暴露接口实现类
 * </desc>
 *
 * @createDate 2018/04/10
 */
@RestController
public class OperateReleaseLogServiceResource implements IOperateReleaseLogServiceClient {
    @Autowired
    IOperateLoggerReleaseLogService iOperateLoggerReleaseLogService;

    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO 查询参数DTO
     * @return page模型
     * @author Qiang.S
     * @createDate 2018/04/10
     */
    @Override
    @RequestMapping(path = "/operate/logger/releaseLog/getPage")
    public Page<OperateReleaseLogVO> getPage(@RequestBody OperateLoggerReleaseLogGetPageDTO pageDTO) throws Exception{
        return iOperateLoggerReleaseLogService.getPage(pageDTO);
    }

    /**
     * <desc>
     *      保存功能
     * </desc>
     *
     * @param operateReleaseLogPO 发布日志实体
     * @return sql执行行数
     * @author Qiang.S
     * @createDate 2018/04/10
     */
    @Override
    @RequestMapping(path = "/operate/logger/releaseLog/save")
    public Integer save(@RequestBody OperateReleaseLogPO operateReleaseLogPO) throws Exception {
        return iOperateLoggerReleaseLogService.save(operateReleaseLogPO);
    }

    /**
     * <desc>
     *      更新功能
     * </desc>
     *
     * @param operateReleaseLogPO 发布日志实体
     * @return sql执行行数
     * @author Qiang.S
     * @createDate 2018/04/10
     */
    @Override
    @RequestMapping(path = "/operate/logger/releaseLog/update")
    public Integer update(@RequestBody OperateReleaseLogPO operateReleaseLogPO) throws Exception{
        return iOperateLoggerReleaseLogService.update(operateReleaseLogPO);
    }
}
